'''
键盘操作的方法：
(1)send_keys(Keys.BACK_SPACE)		#删除键
(2)send_keys(Keys.SPACE)			#空格键
(3)send_keys(Keys.TAB)				#Tab键
(4)send_keys(Keys.ESCAPE)			#ESC键
(5)send_keys(Keys.ENTER)			#回车键
(6)send_keys(Keys.CONTROL,"a")		#全选
(7)send_keys(Keys.CONTROL,"c")		#复制
(8)send_keys(Keys.CONTROL,"x")		#剪切
(9)send_keys(Keys.CONTROL,"v")		#粘贴
(10)send_keys(Keys.F1)				#F1键
(11)......
(12)send_keys(Keys.F12)				#F12键

'''
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from time import sleep
from options import options

driver = webdriver.Chrome(options=options)
driver.get(r'https://www.baidu.com/')
sleep(1)

driver.find_element(By.ID,'kw').send_keys('seleniumm')
sleep(1)
driver.find_element(By.ID,'kw').send_keys(Keys.BACK_SPACE)
sleep(1)
driver.find_element(By.ID,'kw').send_keys(Keys.SPACE)
sleep(1)
driver.find_element(By.ID,'kw').send_keys('教程')
sleep(1)
driver.find_element(By.ID,'kw').send_keys(Keys.CONTROL,'a')
sleep(1)
driver.find_element(By.ID,'kw').send_keys(Keys.CONTROL,'c')
sleep(1)
driver.find_element(By.ID,'kw').send_keys(Keys.CONTROL,'v')
sleep(1)
driver.quit()